<template>
	<view class="container">

		<view class="user-section" >
			<!-- <view class="bg"></view> -->
			<view class="user-info-box">
				<view class="portrait-box" style="padding-left: 20rpx;">
					<view style="width: 150rpx;height: 150rpx;border-radius: 50%;background-color: #D8D8D8;border: 1rpx solid #C0C0C0;">
						<image class="portrait" :src="myUser.data.body.photo"></image>
					</view>
					
				</view>
				<view>
					<view class="info-box" style="margin-top: 8px;display: flex;flex-direction: column;height: 100rpx;">
						
						<view style="flex: 1;">
							<text class="username">{{myUser.data.body.companyName}}</text>
							<text class="username">{{myUser.data.body.name}}</text>
						</view >
						<view style="flex: 1;padding-left: 20rpx;color: white;padding-top: 10rpx;">
						{{myUser.data.body.mobile.substring(0,3)}}*****{{myUser.data.body.mobile.substring(8)}}</view>
						
						
					</view>
				</view>
			</view>
			
			<view class="user-bootem">
				
				<view class="tabuser" style="border-right: 1rpx solid #F8F8F8;">收藏</view>
				<view class="tabuser">积分</view>
				<view class="tabuser" style="border-left: 1rpx solid #F8F8F8;">关注</view>
				
			</view>

		</view>


        <view class="container-bottom">
			<!-- 上 -->
			<view class="container-bottom-1" style="border-bottom: 0rpx;border-top: 0rpx;">
				<view class="container-bottom-1-1" style="display: flex;flex-direction: column;" @click="personalData">
					<view style="flex:5"></view>
					<view style="flex:5;display: flex;border-right: 1rpx solid #E7EBED;z-index: 99;">
						<view style="flex: 2;position: relative;top: -31%;">
							<view class="iconfont" 
							style="width: 86rpx;height: 86rpx;border-radius: 50%;
							background-color: rgb(254, 243, 247);color: #007AFF;font-size: 50rpx;
							line-height: 86rpx;
							position: absolute;right: 19%;top: -29%;
							" >
							&#xe621;
							</view>
						</view>
						<view style="flex: 3;text-align: left;position: relative;top: -31%;">个人资料</view>
						
			
					</view>
					
				</view>
				<view class="container-bottom-1-1" style="display: flex;flex-direction: column;">
					<view style="flex:5"></view>
					<view style="flex:5;display: flex;border-right: 1rpx solid #E7EBED;z-index: 99;">
						<view style="flex: 2;position: relative;top: -31%;">
							<view class="iconfont" 
							style="width: 86rpx;height: 86rpx;border-radius: 50%;
							background-color: rgb(254, 243, 247);color: #007AFF;font-size: 40rpx;
							line-height: 86rpx;
							position: absolute;right: 19%;top: -29%;
							" >
							&#xe616;
							</view>
						</view>
						<view style="flex: 3;text-align: left;position: relative;top: -31%;"  
						@click="certification" >实名认证</view>
						
					</view>
					
				</view>
			</view>
			
			
			
			<!-- 中 -->
			<view class="container-bottom-1" style="border-bottom: 0rpx;">
				<view class="container-bottom-1-1" @click="navTo()">
					
					<view style="flex: 4;position: relative;">
						<view class="iconfont" 
						style="width: 86rpx;height: 86rpx;border-radius: 50%;
						background-color: rgb(237, 247, 254);color: rgb(91, 191, 253);font-size: 50rpx;
						line-height: 86rpx;
						position: absolute;right: 18%;top: 23%;
						" >
						&#xe647;
						</view>
					</view>
					<view style="flex: 6;text-align: left;line-height: 150rpx;">我的提醒</view>
					
				</view>
				<view class="container-bottom-1-1" style="border-left: 1rpx solid #E7EBED;">
					
					<view style="flex: 4;position: relative;">
						<view class="iconfont" 
						style="width: 86rpx;height: 86rpx;border-radius: 50%;
						background-color: rgb(228, 245, 254);color: rgb(91, 191, 253);font-size: 50rpx;
						line-height: 86rpx;
						position: absolute;right: 18%;top: 23%;
						" >
						&#xe62a;
						</view>
					</view>
					<view style="flex: 6;text-align: left;line-height: 150rpx;">用户帮助</view>
					
				</view>
			</view>
			<view class="container-bottom-1" style="border-bottom: 0rpx;">
				<view class="container-bottom-1-1">
					
					<view style="flex: 4;position: relative;">
						<view class="iconfont" 
						style="width: 86rpx;height: 86rpx;border-radius: 50%;
						background-color: rgb(254, 240, 232);color: rgb(254, 160, 97);font-size: 50rpx;
						line-height: 86rpx;
						position: absolute;right: 18%;top: 23%;
						" >
						&#xe602;
						</view>
					</view>
					<view style="flex: 6;text-align: left;line-height: 150rpx;">关于我们</view>
					
				</view>
				<view class="container-bottom-1-1" style="border-left: 1rpx solid #E7EBED;">
					
					<view style="flex: 4;position: relative;">
						<view class="iconfont" 
						style="width: 86rpx;height: 86rpx;border-radius: 50%;
						background-color: rgb(254, 240, 232);color: rgb(254, 160, 97);font-size: 50rpx;
						line-height: 86rpx;
						position: absolute;right: 18%;top: 23%;
						" >
						&#xe77f;
						</view>
					</view>
					<view style="flex: 6;text-align: left;line-height: 150rpx;">设置</view>
					
				</view>
			</view>
			<!-- 下 -->
			<view class="container-bottom-1" style="border-bottom: 0rpx;">
				<view class="container-bottom-1-1">
					
					<view style="flex: 4;position: relative;">
						<view class="iconfont" 
						style="width: 86rpx;height: 86rpx;border-radius: 50%;
						background-color: rgb(216, 254, 194);color: rgb(86, 188, 31);font-size: 50rpx;
						line-height: 86rpx;
						position: absolute;right: 18%;top: 23%;
						" >
						&#xe604;
						</view>
					</view>
					<view style="flex: 6;text-align: left;line-height: 150rpx;">分享</view>
					
				</view>
				<view class="container-bottom-1-1" style="border-left: 1rpx solid #E7EBED;">
					
					<view style="flex: 4;position: relative;">
						<view class="iconfont" 
						style="width: 86rpx;height: 86rpx;border-radius: 50%;
						background-color: rgb(216, 254, 194);color: rgb(86, 188, 31);font-size: 50rpx;
						line-height: 86rpx;
						position: absolute;right: 18%;top: 23%;
						" >
						&#xe637;
						</view>
					</view>
					<view @click="outSystem" style="flex: 6;text-align: left;line-height: 150rpx;">退出</view>
					
				</view>
			</view>

		</view>





		<!-- <view class="cover-container">
			<view style="background: white;border-radius: 8px">
				<image class="arc" src="/static/arc.png"></image>
				<view class="tj-sction" style="margin-top: -8px">
				</view>
			</view>

			<view class="history-section icon">
				<list-cell icon="icon-lishijilu" iconColor="#5eba8f" title="我的消息"
				 @eventClick="navTo('/pages/messagetis/index')"></list-cell>
				
              

			</view>
      </view>
 -->

	</view>
</template>
<script>
	import listCell from '../../components/mix-list-cell';
     let _this;
	export default {
		components: {
			listCell
		},
		data() {
			return {
                myUser:null
			}
		},


        onLoad(){
			_this=this;
			this.myinfo();
		
			
		},
		methods: {
          //<!-- @click="navTo('/pages/messagetis/index')"  极光消息历史页面 -->
			navTo(url) {
				uni.navigateTo({
					url:"/pages/messagetis/index"
				})
			},
			myinfo:function(){
				_this.myUser= uni.getStorageSync("userInfo");

			},
			//个人资料
			personalData(){
				uni.navigateTo({
					url:"./userInfo"
				})
			},
			//实名
			certification(){
				
				uni.navigateTo({
					url:"./certification"
				})
				
				
			},
			outSystem(){
				const value = uni.getStorageSync("JSESSIONID");
				const val = uni.getStorageSync("pathHost");
				 uni.request({
					 url: val+"/ggcapp/logout"+";JSESSIONID="+value+"?__ajax=true&mobileLogin=true",
					 success(data) {
						 console.log(data);
						 if(data.data.success=="1"){
							 uni.showToast({
							     title: data.data.msg,
							     duration: 2000
							 });
							 
							 setTimeout(function(){
								uni.setStorageSync("loginState",false);
								uni.redirectTo({
								   url: '/pages/login/login'
								}); 
							 },1000);
							 
						 }
						/* if(data.data.success!=undefined){
							console.log("请求成功----");
						}else{
							console.log("请求失败----");
							uni.setStorageSync("loginState",false);
							uni.redirectTo({
							   url: '/pages/login/login'
							});
						} */
					}
				})
			}
			



		}
	}
</script>
<style lang='scss'>
	page {
		background: white;
	}



	%flex-center {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	%section {
		display: flex;
		justify-content: space-around;
		align-content: center;
		background: #fff;
		border-radius: 10rpx;
	}

	
	.user-section {
		height: 400rpx;
		position: relative;
        display: flex;
		flex: 22;
		flex-direction: column;
		background-color: #17cb70;
		margin-bottom: 10rpx;
		.user-info-box {
			height: 100rpx;
			padding: 0rpx 20rpx 0rpx 20rpx;
			flex: 16;
			display: flex;
			align-items: center;
			position: relative;
			z-index: 1;
		     
			.portrait {
				width: 140rpx;
				height: 140rpx;
				/*border: 5px solid #fff;*/
				border-radius: 50%;
				position: relative;
				top: 4rpx;
				left: 4rpx;
			}
		
			.username {
				font-size: 16px;
				color: #f2f2f2;
				margin-top: 16px;
				margin-left: 10px;
			}
		
			.username1 {
				font-size: 14px;
				color: whitesmoke;
				margin-top: 16px;
				margin-left: 10px;
			}
		}
		.user-bootem{
			flex: 4;
			background-color: #00B26A;
			display: flex;
			text-align: center;
			padding: 15rpx 0rpx 15rpx 0rpx;
			color: white;
			.tabuser{
				flex: 2;
				line-height: 80rpx;
			}
		}
	}

	.container-bottom{
		
		.container-bottom-1{
			display: flex;
			flex: 20;
			border-top: 1px solid #E7EBED;
			border-bottom: 1px solid #E7EBED;
			height: 150rpx;
			text-align: center;
			.container-bottom-1-1{
				flex: 10;
				display: flex;
			}
		}
		
		
		
	}


</style>
